package cn.xfdzx.android.apps.shop.model;


import java.util.Map;

import cn.xfdzx.android.apps.shop.bean.ConfirmGoodBeen;
import cn.xfdzx.android.apps.shop.bean.HomeSearchRetailGoodsBean;
import cn.xfdzx.android.apps.shop.bean.HomeSearchXFDGoodBeen;
import cn.xfdzx.android.apps.shop.bean.HotSearchBeen;
import cn.xfdzx.android.apps.shop.bean.HotSearchRetailBean;
import cn.xfdzx.android.apps.shop.bean.SearchBeen;
import cn.xfdzx.android.apps.shop.bean.SearchShopBean;
import cn.xfdzx.android.apps.shop.bean.XFDGoodsDetailsBeen;
import cn.xfdzx.android.apps.shop.contract.HomeSearchContract;
import cn.xfdzx.android.apps.shop.contract.XFDGoodsDetailsContract;
import cn.xfdzx.android.apps.shop.net.RetrofitClient;
import io.reactivex.Flowable;

/**
 * @author azheng
 * @date 2018/6/4.O
 * Description：
 */
public class HomeSearchModel implements HomeSearchContract.Model {

    @Override
    public Flowable<HotSearchBeen> initHotSearch() {
        return RetrofitClient.getInstance().getApi().hotSearch();
    }

    @Override
    public Flowable<SearchBeen> initData(String keyword,String indexStatus,String user_current_lng,String user_current_lat) {
        return RetrofitClient.getInstance().getApi().homeSearch(keyword,indexStatus,user_current_lng,user_current_lat);
    }
    @Override
    public Flowable<HomeSearchXFDGoodBeen> initSearchData(String lng,  String lat,String sid, String page, String limit, String index_status, String is_store, String store_id, String keyword, String priceOrder, String salesOrder, String news) {
        return RetrofitClient.getInstance().getApi().homeSearchGoodShop(lng,lat, sid,  page,  limit,  index_status,  is_store,  store_id,  keyword,  priceOrder,  salesOrder,  news);
    }

    @Override
    public Flowable<SearchShopBean> getSearchShopList(Map<String, Object> map) {
        return RetrofitClient.getInstance().getApi().getSearchShopList(map);
    }

    @Override
    public Flowable<HomeSearchRetailGoodsBean> getSearchGoodsList(Map<String, Object> map) {
        return RetrofitClient.getInstance().getApi().getSearchGoodsList(map);
    }

    @Override
    public Flowable<ConfirmGoodBeen> addCar(Map<String, Object> map) {
        return RetrofitClient.getInstance().getApi().addCartGood(map);
    }

    @Override
    public Flowable<HotSearchRetailBean> getRetailHotSearch() {
        return RetrofitClient.getInstance().getApi().getRetailHotSearch();
    }
}
